import { api } from "@/lib/api"; import { countryName, fmtInt, fmtMw } from "@/lib/format"; import { OPERATOR_KIND_LABEL } from "@/lib/labels"; import { OG_CONTENT_TYPE, OG_SIZE, renderOg } from "@/lib/og-template"; export const alt = "Operator profile on DataCenterIndex"; export const size = OG_SIZE; export const contentType = OG_CONTENT_TYPE; export const revalidate = 3600; export default async function Image({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params; const r = await api.operator(slug); if (!r.ok) return renderOg({ eyebrow: "Operator", title: slug.replace(/-/g, " "), subtitle: "Facilities, footprint, capacity and change history." }); const o = r.data; const sub = [o.kind ? OPERATOR_KIND_LABEL[o.kind] : null, o.hqCountryIso2 ? `HQ ${countryName(o.hqCountryIso2)}` : null].filter(Boolean).join(" ยท "); return renderOg({ eyebrow: "Operator", title: o.name, subtitle: sub || "Data center operator", stats: [ { label: "Facilities", value: fmtInt(o.facilityCount) }, { label: "Countries", value: fmtInt(o.countryCount) }, { label: "Known MW", value: o.knownMw ? fmtMw(o.knownMw) : "โ€”" }, { label: "Pipeline", value: o.plannedMw ? `โ‰ˆ ${fmtMw(o.plannedMw)}` : "โ€”" }, ], }); }